package com.gion.flutter_jingjang;


import android.os.Bundle;

import io.flutter.Log;
import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {

    final static String TAG = "MainActivity";
    static final String chanelName = "flutter.study.native/call_native";
    static final String methodName = "call_native_method";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        new MethodChannel(getFlutterView(),chanelName).setMethodCallHandler(
                new MethodChannel.MethodCallHandler() {
                    @Override
                    public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
                        if (methodCall.method.equals(methodName)){
                            Log.d(TAG, "jeek onMethodCall.");
                            result.success(new String("call_native_method" + " jeek flutter native"));
                        }
                    }
                }
        );
        GeneratedPluginRegistrant.registerWith(this);
    }
}
